package com.zhou.cloud.controller;

/**
 * @descrition: 发送消息端
 * @author: zhouyongjun
 * @date: 2022/7/22
 **/
import com.zhou.cloud.config.kafka.KafkaMessageSender;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class KafkaSenderController {
    @Autowired
    private KafkaMessageSender sender;

    @GetMapping("/send")
    public void testKafkaMessageSend(String message) {
        log.warn("message:{}",message);
        sender.sendToDefaultChannel(message);
//        sender.sendToDefaultChannel(message);
//        sender.sendToDefaultChannel(message);
//        sender.sendToDefaultChannel(message);
    }
}
